package com.uzai.common.enums;

/**
 * @Auther: jianghan
 * @Date: 2021/9/15 11:28
 * @Description:
 */
public enum TurnLinkStatusEnum {
    SUCCESS(0,"成功"),
    ERROR(1,"失败"),
    NOT_JOIN_MARKET(2,"未参加推广"),
    DISABLED_GROUP_TURN_LINK(3,"禁止群内查询"),
    NOT_AUTH(4,"未授权"),
    STORE_BLACK(5,"店铺黑名单"),
    NO_PUB_SHARE_PERMISSION(6,"不支持站外分享"),
    IN_HAND(7,"转链处理中"),
    PRICE_COMPARE(8,"比价行为");

    public static final int SUCCESS_VALUE = 0;
    public static final int ERROR_VALUE = 1;
    public static final int NOT_JOIN_MARKET_VALUE = 2;
    public static final int DISABLED_GROUP_TURN_LINK_VALUE = 3;
    public static final int NOT_AUTH_VALUE = 4;
    public static final int STORE_BLACK_VALUE = 5;
    public static final int NO_PUB_SHARE_PERMISSION_VALUE = 6;
    public static final int IN_HAND_VALUE = 7;
    public static final int PRICE_COMPARE_VALUE = 8;

    private Integer id;
    private String desc;

    TurnLinkStatusEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static TurnLinkStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (TurnLinkStatusEnum type: TurnLinkStatusEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
